package com.synergy.stockflow.sales.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.synergy.stockflow.warehouse.entity.Warehouse;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.Date;
import java.util.List;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
//8-7

@Schema
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "quotation")
public class Quotation {
    /**
     * 报价单编码
     */
    @TableId(value = "quotation_id",   type = IdType.ASSIGN_ID)
    @Schema(description="报价单编码")
    private String quotationId;

    /**
     * 报价时间
     */
    @TableField(value = "quotation_time")
    @Schema(description="报价时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date quotationTime;

    /**
     * 客户资源编码
     */
    @TableField(value = "quotation_customer_resources_id")
    @Schema(description="客户资源编码")
    private String quotationCustomerResourcesId;

    /**
     * 销售负责人
     */
    @TableField(value = "quotation_head_of_sales")
    @Schema(description="销售负责人")
    private String quotationHeadOfSales;

    /**
     * 出库仓库
     */
    @TableField(value = "quotation_warehouse")
    @Schema(description="出库仓库")
    private String quotationWarehouse;

    /**
     * 销售原价总额
     */
    @TableField(value = "quotation_original_sale_price")
    @Schema(description="销售原价总额")
    private Double quotationOriginalSalePrice;

    /**
     * 销售实际金额
     */
    @TableField(value = "quotation_sales_actually")
    @Schema(description="销售实际金额")
    private Double quotationSalesActually;

    /**
     * 优惠金额
     */
    @TableField(value = "quotation_discount_amount")
    @Schema(description="优惠金额")
    private Double quotationDiscountAmount;

    /**
     * 折扣率
     */
    @TableField(value = "quotation_discount_rate")
    @Schema(description="折扣率")
    private Double quotationDiscountRate;

    /**
     * 金额大写
     */
    @TableField(value = "quotation_the_amount_is_capitalized")
    @Schema(description="金额大写")
    private String quotationTheAmountIsCapitalized;

    /**
     * 销售金额（不含税）
     */
    @TableField(value = "quotation_the_amount_of_the_sale")
    @Schema(description="销售金额（不含税）")
    private Double quotationTheAmountOfTheSale;

    /**
     * 签订时间
     */
    @TableField(value = "quotaition_date_of_signing")
    @Schema(description="签订时间")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date quotaitionDateOfSigning;

    /**
     * 审批人编码（销售负责人上级）
     */
    @TableField(value = "quotaition_approver")
    @Schema(description="审批人编码（销售负责人上级）")
    private String quotaitionApprover;

    /**
     * 状态（申请中、驳回、进行中、订单完成(部分退货、整批签收)）
     */
    @TableField(value = "quotation_state")
    @Schema(description="状态（申请中、驳回、进行中、订单完成(部分退货、整批签收)）")
    private String quotationState;

    /**
     * 是否需要生产
     */
    @TableField(value = "quotation_procurement")
    @Schema(description="是否需要生产")
    private String quotationProcurement;

    /**
     * 发货时间
     */
    @TableField(value = "quotaion_shipping_time")
    @Schema(description="发货时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date quotaionShippingTime;

    /**
     * 发货地址
     */
    @TableField(value = "quotaion_shipping_address")
    @Schema(description="发货地址")
    private String quotaionShippingAddress;

    /**
     * 详细地址
     */
    @TableField(value = "quotaion_shipping_fulladdress")
    @Schema(description="详细地址")
    private String quotaionShippingFulladdress;

    /**
     * 使用/删除
     */
    @TableField(value = "quotation_isremove")
    @Schema(description="使用/删除")
    private Integer quotationIsremove;

    @TableField(exist = false)
    @Schema(description="客户姓名")
    private String nickname;

    @TableField(exist = false)
    @Schema(description="客户姓名")
    private String nickname1;

    @TableField(exist = false)
    @Schema(description="客户资源")
    private CustomerResources customerResources;

    @TableField(exist = false)
    @Schema(description="仓库")
    private Warehouse warehouse;

    @TableField(exist = false)
    @Schema(description="报价详情")
    private List<QuoteDetails> quoteDetails;
}